<!DOCTYPE html>
<html>
	<head>
		<title>日记</title>
		
<!-------------------- 公共头部 --------------------------->
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		
		<link rel="stylesheet" type="text/css" href="../static/css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="../static/css/mui.previewimage.css"/>
		<link rel="stylesheet" type="text/css" href="../static/css/css.css"/>
		<link rel="stylesheet" type="text/css" href="../static/css/swiper.min.css"/>
		<script type="text/javascript" src="../static/js/swiper.min.js"></script>
		<script type="text/javascript" src="../static/js/mui.min.js"></script>
		<script type="text/javascript" src="../static/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="../static/js/localImg.js"></script>
		<script type="text/javascript" src="../static/js/mobileImg.js"></script>
		<script type="text/javascript" src="../static/js/mui.zoom.js"></script>
		<script type="text/javascript" src="../static/js/mui.previewimage.js"></script>
<!-- 		<script type="text/javascript" src="//res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script> -->
		
		<style type="text/css">
			.divHeight {
			    width: 100%;
			    height: 5px;
			    background: #f5f5f5;
			    position: relative;
			    overflow: hidden;
			}
			
			.mui-show-loading {  
			    position: fixed;  
			    padding: 5px;  
			    width: 120px;  
			    min-height: 120px;  
			    top: 45%;  
			    left: 50%;  
			    margin-left: -60px;  
			    background: rgba(0, 0, 0, 0.6);  
			    text-align: center;  
			    border-radius: 5px;  
			    color: #FFFFFF;  
			    visibility: hidden;  
			    margin: 0;  
			    z-index: 2000;  
			
			    -webkit-transition-duration: .2s;  
			    transition-duration: .2s;  
			    opacity: 0;  
			    -webkit-transform: scale(0.9) translate(-50%, -50%);  
			    transform: scale(0.9) translate(-50%, -50%);  
			    -webkit-transform-origin: 0 0;  
			    transform-origin: 0 0;  
			}  
			.mui-show-loading.loading-visible {  
			    opacity: 1;  
			    visibility: visible;  
			    -webkit-transform: scale(1) translate(-50%, -50%);  
			    transform: scale(1) translate(-50%, -50%);  
			}  
			.mui-show-loading .mui-spinner{  
			    margin-top: 24px;  
			    width: 36px;  
			    height: 36px;  
			}  
			.mui-show-loading .text {  
			    line-height: 1.6;  
			    font-family: -apple-system-font,"Helvetica Neue",sans-serif;  
			    font-size: 14px;  
			    margin: 10px 0 0;  
			    color: #fff;  
			}  
			
			.mui-show-loading-mask {  
			  position: fixed;  
			  z-index: 1000;  
			  top: 0;  
			  right: 0;  
			  left: 0;  
			  bottom: 0;  
			}  
			.mui-show-loading-mask-hidden{  
			    display: none !important;  
			}
			
			.list-nothing {
			    width: 100%;
			    height: 4rem;
			    display: flex;
			    flex-direction: column;
			    align-items: center;
			    justify-content: center;
			    line-height: 1.01;
			}
			.list-nothing__icon {
			    background: url(../static/img/bg_nothing.png) no-repeat 0 0;
			    background-size: contain;
			    width: 2rem;
			    height: 2rem;
			}
			.list-nothing__text {
			    margin-top: 0.4rem;
			    font-size: 0.2rem;
			    color: #151617;
			}
		</style>
		
		<script type="text/javascript">
			//扩展mui.showLoading  
			(function($, window) {  
			    //显示加载框  
			    $.showLoading = function(message,type) {  
			        if ($.os.plus && type !== 'div') {  
			            $.plusReady(function() {  
			                plus.nativeUI.showWaiting(message);  
			            });  
			        } else {  
			            var html = '';  
			            html += '<i class="mui-spinner mui-spinner-white"></i>';  
			            html += '<p class="text">' + (message || "数据加载中") + '</p>';  
		
			            //遮罩层  
			            var mask=document.getElementsByClassName("mui-show-loading-mask");  
			            if(mask.length==0){  
			                mask = document.createElement('div');  
			                mask.classList.add("mui-show-loading-mask");  
			                document.body.appendChild(mask);  
			                mask.addEventListener("touchmove", function(e){e.stopPropagation();e.preventDefault();});  
			            }else{  
			                mask[0].classList.remove("mui-show-loading-mask-hidden");  
			            }  
			            //加载框  
			            var toast=document.getElementsByClassName("mui-show-loading");  
			            if(toast.length==0){  
			                toast = document.createElement('div');  
			                toast.classList.add("mui-show-loading");  
			                toast.classList.add('loading-visible');  
			                document.body.appendChild(toast);  
			                toast.innerHTML = html;  
			                toast.addEventListener("touchmove", function(e){e.stopPropagation();e.preventDefault();});  
			            }else{  
			                toast[0].innerHTML = html;  
			                toast[0].classList.add("loading-visible");  
			            }  
			        }     
			    };  
		
			    //隐藏加载框  
			      $.hideLoading = function(callback) {  
			        if ($.os.plus) {  
			            $.plusReady(function() {  
			                plus.nativeUI.closeWaiting();  
			            });  
			        }   
			        var mask=document.getElementsByClassName("mui-show-loading-mask");  
			        var toast=document.getElementsByClassName("mui-show-loading");  
			        if(mask.length>0){  
			            mask[0].classList.add("mui-show-loading-mask-hidden");  
			        }  
			        if(toast.length>0){  
			            toast[0].classList.remove("loading-visible");  
			            callback && callback();  
			        }  
			      }  
			})(mui, window);
		</script>
<!-------------------- 公共头部 --------------------------->
		
		
		
		<link rel="stylesheet" type="text/css" href="../static/css/share.css"/>
		<link type="text/css" href="../static/css/dialog.css" rel="stylesheet">
		<script type="text/javascript" src="../static/js/mDialogMin.js"></script>
		
		<style type="text/css">
			.popup{
				width:100%;
				border-radius: 10px;
			}
		</style>
		
		
	</head>
	<body>
		<section>
		<div class="aui-dis-user">
			<div class="aui-flex aui-flex-one">
				<div class="aui-user-sml">
					<img alt=""  src="../static/images/100.jpg" >
				</div>
			</div>
			<h2 class="aui-title-head">小宝同学，您好！</h2>
				<div class="aui-arrow aui-arrow-white">
					<a href="./issue.html" >
					 <span style="color: #fff">发布日记 / 相册 </span>
					 </a>
				</div>	
			<img alt="" src="../static/img/head-bg.png" style="width: 100%;height: auto">
		</div>
		</section>
	  <div class="divHeight"></div><div class="divHeight"></div>
	  <div >
	    <ul id="list">	
	      <li>
	        <div class="po-avt-wrap"> 
	        	<img class="po-avt data-avt" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKyib6iav6He2cRyUsUx7yuibXc9l8TwJK9Qx1OpskeiarYrDbPdibFtqribAXILf7NZQd1JIaNvTlXNssg/132"> 
	        </div>
	        <div class="po-cmt">
	          <div class="po-hd">
	            <p class="po-name">
	            	<span class="mui-media-body">这个昵称一定没人用</span>
	            </p>
	            <div class="post">
	              <p>大家好，听说国内冻成狗🐶？我这边还挺热～大家好，听说国内冻成狗🐶？我这边还挺热～大家好，听说国内冻成狗🐶？我这边还挺热～</p>
	              <p> 
	              	<img class="list-img" src="../static/img/ad-003.png" style="height: 100px;"> 
	              	<img class="list-img" src="../static/img/jt1.jpg" style="height: 100px;"> 
	              	<img class="list-img data-avt" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKyib6iav6He2cRyUsUx7yuibXc9l8TwJK9Qx1OpskeiarYrDbPdibFtqribAXILf7NZQd1JIaNvTlXNssg/132" style="height: 100px;"> 
	              	<img class="list-img data-avt" src="../static/img/guide2.png" style="height: 100px;"> 
	              </p>
	            </div>
	            <p class="time">刚刚</p>
	          </div>
	        </div>
	      </li>
	      <li>
	        <div class="po-avt-wrap"> 
	        	<img class="po-avt data-avt" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKyib6iav6He2cRyUsUx7yuibXc9l8TwJK9Qx1OpskeiarYrDbPdibFtqribAXILf7NZQd1JIaNvTlXNssg/132"> 
	        </div>
	        <div class="po-cmt">
	          <div class="po-hd">
	            <p class="po-name">
	            	<span class="mui-media-body">这个昵称一定没人用</span>
	            </p>
	            <div class="post">
	              <p>大家好，听说国内冻成狗🐶？我这边还挺热～大家好，听说国内冻成狗🐶？我这边还挺热～大家好，听说国内冻成狗🐶？我这边还挺热～</p>
	              <p> 
	              	<img class="list-img" src="../static/img/ad-003.png" style="height: 100px;"> 
	              	<img class="list-img" src="../static/img/jt1.jpg" style="height: 100px;"> 
	              	<img class="list-img data-avt" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKyib6iav6He2cRyUsUx7yuibXc9l8TwJK9Qx1OpskeiarYrDbPdibFtqribAXILf7NZQd1JIaNvTlXNssg/132" style="height: 100px;"> 
	              	<img class="list-img data-avt" src="../static/img/guide2.png" style="height: 100px;"> 
	              </p>
	            </div>
	            <p class="time">刚刚</p>
	          </div>
	        </div>
	      </li>
	     <div class="divHeight"></div>
	    </ul>
	    
	    <div class="list-nothing" style="display: none">
	      <div class="list-nothing__icon"></div>
	      <div class="list-nothing__text">暂无日志，快去发布一条吧</div>
	    </div>
	    
	    
	   <p id="listend"  data-page="1" data-total="1"  style="text-align: center;margin-top: 10px;display: none">
	   		<span class="mui-icon mui-icon-spinner-cycle mui-spin"></span>
	   </p>
	  </div>
	  <br/><br/><br/>
	<div class="big_img">
	    <div class="swiper-container2 swiper-container-horizontal">
	      <div class="swiper-wrapper">
	      </div>
	    </div>
	    <div class="swiper-pagination2 swiper-pagination-bullets"><span class="swiper-pagination-bullet swiper-pagination-bullet-active"></span></div>
	</div>
	 
	<footer>
		<li onclick=mui.openWindow('message.html')><span>
			<img src="../static/img/tabs/info.svg" ></span><span>消息</span>
		</li>
		<li onclick=mui.openWindow('friends.html')>
			<span><img src="../static/img/tabs/friend.svg" ></span><span>TA</span>
		</li>
		<li onclick=mui.openWindow('share.html')>
			<span><img src="../static/img/tabs/find.1.svg" ></span><span style="color:#01CAFD">日记</span>
		</li>
		<li onclick=mui.openWindow('home.html')>
			<span><img src="../static/img/tabs/min.svg" ></span><span>我的</span>
		</li>
	</footer>
	
<script type="text/javascript">
var showTips=1;
var interact=2;
var traceNum=3;
var interVal=4;
var popup='5';


function closeDialog(h){
	var j;
	var k=document.querySelectorAll('.c_alert_dialog');
	[].forEach.call(k,function(l) {
	(l.dataset.index==h||l===h.parentNode)&&(l.classList.remove('dialog_open'),l.classList.add('dialog_close'),j&&j.call(l.querySelector('.c_alert_wrap'),h),l.querySelector('.c_alert_wrap').addEventListener('animationend',function() {
	l.remove()
	}
	))})
}


function saveChat(h,text){
	if(!(/[\u4e00-\u9fa5]{4,}/.test(text))){
		mui.toast('请输入4字以上的中文话句喔',{ duration:'10', type:'div' });
		return;
	}
	$.ajax({
		url: '[[${sysUrl}]]/wensay/chat/save',
		type: "post",
		data:{
			'type':"1",
			'text': text
		},
		dataType: "json",
		success:function(data){
			if(data.meta.success){
				closeDialog(h);
				mui.toast('发送成功',{ duration:'10', type:'div' });
        		window.location.href = "[[${sysUrl}]]/wensay/message.html";
			}else{
				mui.toast('系统异常...',{ duration:'10', type:'div' });
			}
		}
	});
}
function saveShare(h,text){
	if(!(/[\u4e00-\u9fa5]{4,}/.test(text))){
		mui.toast('请输入4字以上的中文话句喔',{ duration:'10', type:'div' });
		return;
	}
    $.ajax({
        type: "POST",
        url: '[[${sysUrl}]]/wensay/share/save',
        data: {
			"text":text,
			"imgs":""
        },
        dataType:"json",
        success: function(data){
        	if(data.meta.success){
        		closeDialog(h);
        		mui.toast('发布成功!',{ duration:'10', type:'div' });
        		window.location.href = "[[${sysUrl}]]/wensay/share.html";
            }else{
        	   mui.toast('系统异常...',{ duration:'10', type:'div' });
            }
         },
         complete :function(XMLHttpRequest, textStatus){
        	
         },
         error:function(XMLHttpRequest, textStatus, errorThrown){ 
        	 mui.toast('系统异常...',{ duration:'10', type:'div' });
         }
     }); 		
}
</script>
<script type="text/javascript">
var sysUrl="[[${sysUrl}]]";
var imgUrl="[[${imgUrl}]]";
var isPage=true;

$(function(){
	if(isPage){
		isPage=false;
		page();
	}
	
})

function del_share(id){
	mui.confirm('确定删除此日记？',' ',['否','是'],function(e) {
		if(e.index==1){
			$.ajax({
				url: '[[${sysUrl}]]/wensay/share/del',
				type: "post",
				data:{
					'id': id
				},
				dataType: "json",
				success:function(data){
					if(data.meta.success){
						$("#li_"+id).hide();
						$("#div_"+id).hide();
						mui.toast('删除成功。',{ duration:'10', type:'div' });
					}else{
						mui.toast('系统异常...',{ duration:'10', type:'div' });
					}
				}
			});
		}	
	});
}



$(window).scroll(function() {
	
    if ($(document).scrollTop()<=0){
    	
    }
    if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
    	if(isPage){
    		isPage=false;
    		page();
    	}
    }
});


function page(){
	var pageNo=$("#listend").data("page");
	var pageSize=20;
	$.ajax({
		url: '[[${sysUrl}]]/wensay/share/page',
		type: "post",
		data:{
			'pageNo': pageNo,
			'pageSize':pageSize,
		},
		dataType: "json",
		success:function(data){
			if(data.meta.success){
				var content=data.data.content;
				if(pageNo==1 && content.length<=0){
					$(".list-nothing").show();
				}else{
					$(".list-nothing").hide();
				}
				var html=[];
				for (var i = 0; i < content.length; i++) {
					html.push('<li id="li_'+content[i].id+'">');
					html.push(' <div class="po-avt-wrap"> ');
					html.push('	<img class="po-avt data-avt" src="'+content[i].weixin_photo+'"> ');
					html.push(' </div>');
					html.push(' <div class="po-cmt">');
					html.push(' <div class="po-hd">');
					html.push(' <p class="po-name">');
						html.push(' <span class="mui-media-body">'+content[i].wx_name+'</span>');
					html.push(' </p>');
					html.push(' <div class="post">');
					html.push(' <p>'+content[i].text+'</p>');
					html.push(' <p> ');
						if(content[i].img1!=null && content[i].img1!=null){
							html.push('	<img class="list-img" src="'+imgUrl+content[i].img1+'" data-preview-src="" data-preview-group="1" style="height: 100px;"> ');
						}
						if(content[i].img2!=null && content[i].img2!=null){
							html.push('	<img class="list-img" src="'+imgUrl+content[i].img2+'" data-preview-src="" data-preview-group="1" style="height: 100px;"> ');
						}
						if(content[i].img3!=null && content[i].img3!=null){
							html.push('	<img class="list-img" src="'+imgUrl+content[i].img3+'" data-preview-src="" data-preview-group="1" style="height: 100px;"> ');
						}
						if(content[i].img4!=null && content[i].img4!=null){
							html.push('	<img class="list-img" src="'+imgUrl+content[i].img4+'" data-preview-src="" data-preview-group="1" style="height: 100px;"> ');
						}
						if(content[i].img5!=null && content[i].img5!=null){
							html.push('	<img class="list-img" src="'+imgUrl+content[i].img5+'" data-preview-src="" data-preview-group="1" style="height: 100px;"> ');
						}
						if(content[i].img6!=null && content[i].img6!=null){
							html.push('	<img class="list-img" src="'+imgUrl+content[i].img6+'" data-preview-src="" data-preview-group="1" style="height: 100px;"> ');
						}
					html.push(' </p>');
					html.push(' </div>');
					html.push(' <p class="time">');
						html.push('<span>'+content[i].time+'</span>');
						html.push('&nbsp;&nbsp;&nbsp;<span onClick="javascript:del_share(\''+content[i].id+'\');" data-id="'+content[i].id+'">删除</span>&nbsp;&nbsp;&nbsp;');
					html.push(' </p>');
					html.push(' </div>');
					html.push(' </div>');
					html.push(' </li>');
					html.push(' <div id="div_'+content[i].id+'" class="divHeight"></div>');
					
				}
				$('#list').append(html.join(""));
				$("#listend").data("page",pageNo+1);
				$("#listend").data("total",data.data.totalPages);
				if(pageNo>=data.data.totalPages){
					$("#listend").hide();
				}else{
					$("#listend").show();
				}
				isPage=true;
			}else{
				mui.toast('系统异常...',{ duration:'10', type:'div' });
			}
		}
	});
}



</script>

<script>
	mui.previewImage();
</script>
	</body>
</html>